package cn.stronglink.assetmanage.business.inspection.presenter;

import java.util.List;

import cn.stronglink.assetmanage.business.inspection.model.RepairModel;
import cn.stronglink.assetmanage.business.inspection.view.repair.RepairView;
import cn.stronglink.assetmanage.entity.Repair;

/**
 * 维修单presenter
 * Created by zhengjinglan on 2018/6/21.
 */

public class RepairPresenter {

    private RepairModel repairModel;
    private RepairView repairView;
    //维修单列表
    private List<Repair> repairList;
    //选择的表单
    private Repair repair;
    public RepairPresenter(RepairModel repairModel, RepairView repairView){
        this.repairModel = repairModel;
        this.repairView = repairView;

    }
    /**
     * 显示详情页面
     *
     * @param position
     */
    public void showOrderByPosition(int position) {
        Repair repair = repairList.get(position);
        repairView.showOrderDetail(repair.getId_());
    }

    /**
     * 初始化维修单列表
     */
    public void initRepairListData(){
        repairList = repairModel.getDataByRepairIdDistince();
        repairView.setListData(repairList);
    }

}
